package test;

import pojo.Employee;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class test {
    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException, NoSuchFieldException {
        Class ciz = Employee.class;
//        构造
        Constructor constructor = ciz.getConstructor(String.class, String.class,String.class,double.class);
        Employee E = (Employee) constructor.newInstance("JD001", "福星","java软件开发工程师",12000.0);
        Method showInfo = ciz.getMethod("showInfo");
        showInfo.invoke(E);
    }
}
